#include<stdio.h>
#include<stdlib.h>
#include<string>
#include<iostream>

using namespace std;
int main(){
	int n,c[100];
	cin>>n;
	int a,b;
	for(int i=0;i<n;i++){
	cin>>a>>b;
	a=a%100;b=b%100;
	c[i]=(a+b)%100;
	} 
	for(int i=0;i<n;i++){cout<<c[i]<<"\n";}
}